<?php
/**
 * Created by PhpStorm.
 * User: jacob
 * Date: 18-8-7
 * Time: 上午11:45
 */
namespace API;

use DB\Article;
use Tiny\Request;
use Tiny\Response;
use Tiny\ServiceAPI;
use Tiny\ServiceRequestData;
use Tiny\ServiceResponseData;

class CommandStatsRequestData extends ServiceRequestData{

}
class CommandStatsResponseData extends ServiceResponseData{
  public $result;
  public $obj;
}
class CommandStats extends ServiceAPI{
  protected function run(Request $request, Response $response) {
    $article = new Article();
    $response->data = new CommandStatsResponseData();
    $response->data->result = $article->aggregate();
    $response->data->obj = \ProjectInit::$objects;

  }
}